import http from './index'

export function login(username, password, captchaCode) {
  return http.post(
    'api/v1/login',
    new Form({ username, password, captchaCode })
  )
}

export function getPermissions() {
  return http.get('api/v1/permissions')
}

export function logout() {
  return http.post('api/v1/logout')
}

export function handleLogin(username, password) {
  return http.post('api/v1/login', new Form({ username, password }))
}
